package com.ruoyi.system.api.factory;

import java.util.List;

import com.ruoyi.system.api.domain.SysDictData;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.system.api.RemoteSysDictTypeService;
import com.ruoyi.system.api.domain.SysDictType;

/**
 * 字典类型微服务降级处理
 * 
 * @author ruoyi
 * @date 2023-04-27
 */
@Component
public class RemoteSysDictTypeFallbackFactory implements FallbackFactory<RemoteSysDictTypeService>
{
    private static final Logger log = LoggerFactory.getLogger(RemoteSysDictTypeFallbackFactory.class);

    @Override
    public RemoteSysDictTypeService create(Throwable throwable)
    {
        log.error("字典类型服务调用失败:" + throwable.getMessage(), throwable);
        return new RemoteSysDictTypeService()
        {
            @Override
            public R<SysDictType> selectSysDictTypeByDictId(Long dictId, String source) {
                return null;
            }

            @Override
            public R<List<SysDictType>> selectSysDictTypeList(SysDictType sysDictType, String source) {
                return null;
            }

            @Override
            public R<Integer> insertSysDictType(SysDictType sysDictType, String source) {
                return null;
            }

            @Override
            public R<Integer> updateSysDictType(SysDictType sysDictType, String source) {
                return null;
            }

            @Override
            public R<Integer> deleteSysDictTypeByDictIds(Long[] dictIds, String source) {
                return null;
            }

            @Override
            public R<List<SysDictData>> selectDictDataByType(String dictType, String source) {
                return null;
            }

            @Override
            public R<SysDictType> selectDictTypeByType(String dictType, String inner) {
                return null;
            }
        };

    }
}
